package com.cloudkinto.service.company.vo;

import com.cloudkinto.bo.common.BaseQueryBo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
public class ProductQueryDetailResponse {

    @JsonProperty("totalCount")
    private Long totalCount;
    @JsonProperty("skuInfoList")
    private List<SkuInfoListDTO> skuInfoList;

    public ProductQueryDetailResponse() {
    }

    public ProductQueryDetailResponse(Long totalCount, List<SkuInfoListDTO> skuInfoList) {
        this.totalCount = totalCount;
        this.skuInfoList = skuInfoList;
    }

    @NoArgsConstructor
    @Data
    public static class SkuInfoListDTO {
        @JsonProperty("cwSkuCode")
        private String cwSkuCode;
        @JsonProperty("name")
        private String name;
        @JsonProperty("enName")
        private String enName;
        @JsonProperty("categories")
        private CategoriesDTO categories;
        @JsonProperty("propertyList")
        private List<PropertyListDTO> propertyList;
        @JsonProperty("sentitiveProperty")
        private SentitivePropertyDTO sentitiveProperty;
        @JsonProperty("barCodeList")
        private List<BarCodeListDTO> barCodeList;
        @JsonProperty("outerPackage")
        private OuterPackageDTO outerPackage;
        @JsonProperty("specProperty")
        private SpecPropertyDTO specProperty;
        @JsonProperty("salesLinkList")
        private List<SalesLinkListDTO> salesLinkList;
        @JsonProperty("imageUrl")
        private String imageUrl;

        @Data
        public static class CategoriesDTO {
            @JsonProperty("cat1Name")
            private String cat1Name;
            @JsonProperty("cat2Name")
            private String cat2Name;
            @JsonProperty("cat3Name")
            private String cat3Name;
            @JsonProperty("cat4Name")
            private String cat4Name;
            @JsonProperty("cat5Name")
            private String cat5Name;
            @JsonProperty("cat6Name")
            private String cat6Name;
            @JsonProperty("cat7Name")
            private String cat7Name;
            @JsonProperty("cat8Name")
            private String cat8Name;
            @JsonProperty("cat9Name")
            private String cat9Name;
            @JsonProperty("cat10Name")
            private String cat10Name;

            public CategoriesDTO() {
            }

            public CategoriesDTO(String cat1Name, String cat2Name, String cat3Name) {
                this.cat1Name = cat1Name;
                this.cat2Name = cat2Name;
                this.cat3Name = cat3Name;
            }
        }

        @NoArgsConstructor
        @Data
        public static class SentitivePropertyDTO {
            @JsonProperty("isSensitive")
            private Integer isSensitive;
            @JsonProperty("sentitiveTypeList")
            private List<Integer> sentitiveTypeList;
            @JsonProperty("sensitiveLimit")
            private SensitiveLimitDTO sensitiveLimit;

            @NoArgsConstructor
            @Data
            public static class SensitiveLimitDTO {
                @JsonProperty("maxKnifeLength")
                private Integer maxKnifeLength;
                @JsonProperty("maxKnifeLengthHp")
                private Integer maxKnifeLengthHp;
                @JsonProperty("knifeTipAngle")
                private Integer knifeTipAngle;
            }
        }

        @Data
        public static class OuterPackageDTO {
            @JsonProperty("packageShape")
            private Integer packageShape;
            @JsonProperty("packageType")
            private Integer packageType;

            public OuterPackageDTO() {
            }

            public OuterPackageDTO(Integer packageShape, Integer packageType) {
                this.packageShape = packageShape;
                this.packageType = packageType;
            }
        }

        @Data
        public static class SpecPropertyDTO {
            @JsonProperty("length")
            private String length;
            @JsonProperty("width")
            private String width;
            @JsonProperty("height")
            private String height;
            @JsonProperty("weight")
            private String weight;
            @JsonProperty("color")
            private String color;
            @JsonProperty("model")
            private String model;

            public SpecPropertyDTO() {
            }

            public SpecPropertyDTO(String length, String width, String height, String weight, String color) {
                this.length = length;
                this.width = width;
                this.height = height;
                this.weight = weight;
                this.color = color;
            }
        }

        @NoArgsConstructor
        @Data
        public static class PropertyListDTO {
            @JsonProperty("propName")
            private String propName;
            @JsonProperty("propValue")
            private String propValue;
            @JsonProperty("propUnit")
            private String propUnit;
        }

        @Data
        public static class BarCodeListDTO {
            @JsonProperty("code")
            private String code;
            @JsonProperty("codeType")
            private Integer codeType;

            public BarCodeListDTO() {
            }

            public BarCodeListDTO(String code, Integer codeType) {
                this.code = code;
                this.codeType = codeType;
            }
        }

        @NoArgsConstructor
        @Data
        public static class SalesLinkListDTO {
            @JsonProperty("url")
            private String url;
            @JsonProperty("platform")
            private String platform;
        }
    }
}
